package com.states
{
	import com.greensock.events.LoaderEvent;
	import com.greensock.loading.LoaderMax;
	import com.managers.StateManager;
	import com.managers.XmlManager;
	
	import flash.events.Event;
	
	public class Preloader extends State 
	{
		
		
		public function Preloader() 
		{
			//var queue:LoaderMax = LoaderMax.parse(["config.xml"], { onComplete:onComplete } );
			XmlManager.instance.loadFile("xml/skills.xml", "skills");
			XmlManager.instance.addEventListener("skills_LOADED", onComplete);
			//queue.prependURLs("xml/");
			//queue.load();
		}
		
		private function onComplete(e:Event):void {
			StateManager.instance.changeState(new MainTool());
			dispatchEvent(new Event(Event.COMPLETE));
		}
		
		public override function update():void {

		}
		
		public override function draw():void {

		}
		
		public override function kill():void{			

		}
	}
}